package com.briup.day11;

import com.briup.day11.bean.School;

/**
 * @author ThinkBook
 */
public class Test03_School {
    //static代码块测试
    public static void main(String[] args) {
        // 第一次 使用School类，访问其static成员，则先加载School类
        // 随着类的加载，static代码块 执行
        System.out.println("图书馆名称: " + School.library);

        School.setLibrary("逸夫楼");
        School s1 = new School("三中",2300);
        s1.show();
    }
    //static方法测试
    public static void main02(String[] args) {
        School s1 = new School("一中",3000);
        s1.show();

        // 借助 类名.static方法(实参列表);
        //School.setLibrary("凌志楼");

        // 借助 对象名.static方法(实参列表);
        s1.setLibrary("雷军楼");
        System.out.println("图书馆: " + School.library);

        s1.show();
    }
    public static void main01(String[] args) {
        System.out.println("公共图书馆："+ School.library);

        School s1 = new School("一中",3000);
        s1.show();

        School s2 = new School("秀峰",2500);
        s2.library = "逸夫楼";
        s2.show();

        School.library = "军子楼";
        School s3 = new School("娄江",1800);
        s3.show();
    }
}
